package com.boot.repository;

import com.boot.entity.School;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;
@Repository
@Transactional
public interface SchoolRepository extends JpaRepository<School, Integer>, JpaSpecificationExecutor<School> {
    School findBySchoolId(Integer id);
    void deleteBySchoolId(Integer id);
    Boolean existsBySchoolId(Integer id);
    @Query(value = "select s from School s  where s.schoolName like concat('%',?1,'%') ")
    List<School> findAllBySchoolNameLike(String keyword);

}
